<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<title>补充艺术家资料</title>
<link href="../style/css_member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script src="../js/artDialog.js?skin=gray"></script>
<script src="../js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript">

$(function(){
	$("#galleryLink").click(function(){
		art.dialog.open('${ctx}/fileUpload!uploadPrepare.do?imgType=gallery&sharpId=9',{title:'上传画廊Logo图片',width:800,height:550,lock:true},false);
    });
    
	$("a[name='addPaintingHref']").click(function(){
		art.dialog.open('${ctx }/painting/addPrepare.do',{title:'添加作品',width:820,height:550,lock:true},false);
    });

	m1('m1_011');
});

	/**********提交前检查表单*****************/
	function checkForm(){

		var name = $.trim($("#name").val());
		if( name  ==  ""){
			$("#name").focus();
			 alert("画廊名称不能为空。");
			 return false;
		}

		var picImage = $("#picImage").val();
		if( picImage == "" ){
			alert("请上传画廊Logo照片");
			return false;
		}

		var description =  $.trim($("#description").val());
		if( description  ==  ""){
			$("#description").val("");
			$("#description").focus();
			alert("画廊简介不能为空。");
			return false;
		}

		var province = $("#provinceInfoSelect").val();
		if( province == ""){
			 alert("请选择所在省。");
			 return false;
		}

		var city = $("#cityInfoSelect").val();
		if( city == ""){
			 alert("请选择所在市。");
			 return false;
		}
		
		var address = $.trim($("#address").val());
		/*if( address  ==  ""){
			$("#address").focus();
			 alert("请填写展览地点。");
			 return false;
		}*/
		
		if(window.confirm("确认提交？")){
			$("#galleryForm").submit();
		}
	}

</script>
</head>

<body>

<!-- 页面头部  -->
<jsp:include page="/commons/head_member.jsp"></jsp:include>

<form action="${ctx }/gallery/galleryAction!save.do" method="post" id="galleryForm" name="galleryForm">
<table width="930" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #ccc;" align="center">
          <tr>
            <td>&nbsp;</td>
            <td align="center" class="bt14A">填写画廊资料</td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 画廊名称：</td>
            <td class="bt14A"><input name="gallery.name" type="text" size="40" id="name" maxlength="40"></td>
            <td width="198" rowspan="6" valign="top" class="bt14A" align="center">
                  <table width="165" height="217" border="0" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC" bgcolor="#CCCCCC">
                    <tr>
                      <td bgcolor="#FFFFFF">
                      	<div id="photoTd" style="width: 165px;height: 217px;vertical-align: middle;text-align: center;overflow: hidden;"></div>
                      </td>
                    </tr>
                  </table>
            </td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 上传画廊logo：</td>
            <td class="bt14A"><span class="style18"><a id="galleryLink" style="cursor: pointer;color: red">上传</a></span></td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 画廊简介：</td>
            <td class="bt14A">
              <textarea name="gallery.description" cols="65" rows="8" id="description"></textarea>
            </td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 所在地：</td>
            <td class="bt14A">
                <select name="gallery.provinceInfo.id" id="provinceInfoSelect" onchange="changeProvince()">
                        <option value="">选择省份</option>
                        <c:forEach items="${provinceInfoList}" var="provinceInfo" varStatus="status">
				            <option value="${ provinceInfo.id}"/> ${ provinceInfo.name}</option>
				        </c:forEach>
                </select>
                <select name="gallery.cityInfo.id" id="cityInfoSelect">
                  <option value="">选择县市</option>
                </select>
                <input name="gallery.address" type="text" size="40" id="address">
               </td>
          </tr>
          <tr>
            <td class="bt14A" align="right">业务联系人：</td>
            <td class="bt14A"><input name="gallery.contact" type="text" size="20" id="contact"></td>
          </tr>
          <tr>
            <td class="bt14A"  align="right">咨询电话：</td>
            <td class="bt14A"><input name="gallery.tel" type="text" size="20" id="tel">
            	<!-- 隐藏域 begin -->
		            <input name="gallery.imageInfo.id" type="hidden"  id="picImage">
		        <!-- 隐藏域 end --> 
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td width="539" class="nw12a" align="left">
           		 <img src="../images/an24.gif" width="114" height="31" onClick="javascript:checkForm()" style="cursor: pointer ;border: 0"></td>
          </tr>
   </table>
</form>

 <%@ include file="/member/list_painting_fragment.jsp" %>

<jsp:include page="/commons/foot_member.jsp"></jsp:include>

</body>
</html>